package org.example.user.warning.service;

import org.example.commons.entity.SysMessage;
import org.example.commons.service.IBaseService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

/**
 * @author bothin
 */
public interface ISysMessageService extends IBaseService<SysMessage> {

    Page<SysMessage> findUserMessage(Long userId, String status, Pageable pageable);

    Page<SysMessage> findUserMessage(Long userId,  Pageable pageable);

    Page<SysMessage> findBackendMessage(String status, Pageable pageable);

    Page<SysMessage> findBackendMessage(Pageable pageable);

    List<SysMessage> findBackendMessage();

    List<SysMessage> findBackendByStatusMessage(String status);

    List<SysMessage> findByMessageIdIn(Long[] ids);

    Page<SysMessage> searchList(String name, String title, Date[] dates, String status, Pageable pageable);

    /**
     * 更新消息为已读
     * @param id
     * @param status
     * @return
     */
    SysMessage updateReadStatus(Long id, String status);

}
